package com.lwlk.zdk.service.User.impl;

import com.lwlk.zdk.mapper.sys.sysUserMapper;
import com.lwlk.zdk.model.sys.sysUser;
import com.lwlk.zdk.service.User.JoinService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class JoinServiceImpl implements JoinService {

    @Autowired
    sysUserMapper sysUserMapper;

    @Override
    public int add(sysUser sysUser) {
        int i = sysUserMapper.insertSelective(sysUser);
        return i;
    }

    @Override
    public int update(sysUser sysUser) {
        int i = sysUserMapper.updateByPrimaryKeySelective(sysUser);
        return i;
    }

    @Override
    public int joinCount(String roleType) {
        int count=sysUserMapper.joinCount(roleType);
        return count;
    }

    @Override
    public List<Map<String,Object>> selectByPlatformId(Integer platformId) {
        List<Map<String,Object>> sysUser = sysUserMapper.selectByPrimaryKey(platformId);
        return sysUser;
    }

    @Override
    public String selectAccessCode(Integer platformId) {
        String objectId=sysUserMapper.selectAccessCode(platformId);
        return objectId;
    }

    @Override
    public int delete(Integer platformId) {
        int i = sysUserMapper.deleteByPrimaryKey(platformId);
        return i;
    }

    @Override
    public List<Map<String, Object>> searchUser(String cityRole) {
        List<Map<String,Object>>userList=sysUserMapper.searchUser(cityRole);
        return userList;
    }

    @Override
    public List<Map<String, Object>> searchNotAdmin(String cityRole) {
        List<Map<String,Object>>userList=sysUserMapper.searchNotAdmin(cityRole);
        return userList;
    }

    @Override
    public List<Map<String, Object>> searchJQ(String roleType) {
        List<Map<String,Object>>JQList=sysUserMapper.searchJQ(roleType);
        return JQList;
    }

    @Override
    public List<Map<String, Object>> searchFQ(String roleType) {
        List<Map<String,Object>>FQList=sysUserMapper.searchFQ(roleType);
        return FQList;
    }

    @Override
    public String searchPlatformId(int platformId) {
        String areaCode=sysUserMapper.searchPlatformId(platformId);
        return areaCode;
    }
}
